home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 266_01 / plox.doc < prev    next >
Text File  |  1990-07-20  |  16KB  |  313 lines

  1.                        micro PLOX                          PLOX.DOC
  2.                        Version 5.0
  3.  
  4.                        Bob Patton
  5.                   1713 Parkcrest Terrace
  6.                    Arlington, TX 76012
  7.                        July 1990
  8.  
  9. Micro PLOX is a plotting language that gives the user direct control
  10. of the plotting features of a dot matrix printer or a graphics
  11. monitor.  It was designed with graphs in mind, but it can be used
  12. to make forms and straight line drawings.
  13.  
  14. It will draw lines in various patterns and print text in 2 compact
  15. fonts.  The maximum area of a single drawing is 7 inches wide by
  16. 5 inches high which is roughly half of a standard typewriter page
  17. with margins allowed.  From data it will draw line or bar graphs.
  18. The lines may be of various patterns and colors and the points may
  19. be shown with a symbol or not.  The bars may have various hatching
  20. patterns.  The text may be located at a specific location with a
  21. TITLE or may be located relative to data with a LABEL.
  22.  
  23. Statements in PLOX consist of a keyword (in capitals recommended for
  24. readability) followed by options in lower case and digits. (Text strings
  25. should be upper and lower case as wanted.  File names may be upper or
  26. lower case.) For example:
  27.  
  28.   *    Sample stock plot
  29.   PIC size 7 by 2.5  outline
  30.   TITLE at 3.5,2.4 text NORTHEAST INVESTOR'S TRUST
  31.   AREA at .5,.5  size 6 by 1.8
  32.   AXIS left  to 30
  33.   AXIS below  from 85 to 88 boxes=3
  34.   LINE file  B:NOEAST.DAT  item 1 is yymmdd
  35.  
  36. PLOX is interpretive;  items specified are drawn as they are
  37. encountered so the statements must be pretty much in the order
  38. shown.  PIC must come first as it starts the process and sets
  39. the reference point for further dimensions given.
  40.  
  41. TITLE may come anyplace but its location will be affected by what
  42. has come before it. In the example above the title is centered at
  43. coordinates 3.5,2.4 inches with respect to the whole picture which
  44. has a size of 7 inches wide by 2.5 inches high.
  45.  
  46. An AREA is a rectangular field in which to put plots.  It has a
  47. location (of the lower, left corner) and a size.  Any titles given
  48. after an AREA are located with respect to the location of the AREA.
  49.  
  50. Both an x and a y AXIS must be specified to scale the data.  An AXIS
  51. is presumed to start at 0 unless shown otherwise by a "from" option.
  52. You may specify the number of scale divsions as "boxes" or let PLOX
  53. do it for you.
  54.  
  55. A LINE may now be drawn from a data file with a pairs of x and y data
  56. points.  You must give the name of the data file.  You may have date
  57. data in the form yymmdd and so specify to PLOX.  These will be converted
  58. to YY.fract for plotting.  For example 870630 might be converted to
  59. 87.496.
  60.  
  61. BARS may also be drawn from x and y data pairs.  The bars may be
  62. horizontal or vertical and will normally extend from the data point to
  63. the axis, but you may specify a different base (in data-units, not inches).
  64. You may specify the width of a bar (in inches).
  65.  
  66. You can in general have more than one of each statement (except PIC).
  67. Just remember that order counts.  You can have many LINEs in an AREA.
  68. You can have many AREAs in a PIC, and you can put TITLEs anywhere.
  69. You can even put more than 2 axes on a area, but the data plotted will
  70. be scaled to the last x and last y AXIS given.
  71.  
  72. The options on a given statement may come in any order and may be spaced
  73. to suit yourself.  The only current exception is the text of a title
  74. which must be last and may be on a separate TITLE statement if it is
  75. long.  The title is drawn as soon as the text is encountered.  There are
  76. optional punctuation and filler words for readability.  You may use
  77. commas and equal signs anywhere.  The words "by", "is", and "are" are
  78. ignored.   Comments may be included with PLOX statements by starting
  79. the comment line with an asterisk.
  80.  
  81.               Getting a plot printed
  82.  
  83. This is a two step process.  Write the PLOX statements and provide a
  84. data file with the numbers to be plotted.  A naming convention is
  85. recommended.  We suggest .PIC for the PLOX statements and .DAT for
  86. data files.  Execute the PLOX command giving the name of your file
  87. of PLOX statements:
  88.  
  89.                PLOX MYPLOX.PIC
  90.  
  91. This will create a binary file of plot commands named PLOTCOM.DAT.
  92. Then run program PLOTEPS or PLOTEPS2 which will output directly to
  93. your printer.  As the name suggests this device driver is for Epson
  94. printers, but device drivers for graphics monitors are also provided.
  95.  
  96.                PLOTEPS   or  PLOTEPS2
  97.  
  98. That's all there is to it.  PLOTEPS expects its input in PLOTCOM.DAT
  99. which is a little limiting, but simple to run and less error prone.
  100. There is really not much need to save the binary file of plot commands
  101. since it can always be recreated from the PLOX statements, but you
  102. could rename it if you did want to keep it.
  103.  
  104. If your printer ribbon is worn or you are making a chart for photo
  105. copying you can add the letter d after the command to get dark print
  106. which is done by just printing each line twice.  For example:
  107.  
  108.               PLOTEPS d
  109.  
  110. You can also view the chart on a graphics monitor if you have one.
  111. Simply use PLOTHERC, PLOTCGA, PLOTEGA, or PLOTVGA as the second
  112. command.  You can use this to debug charts or as the only way you
  113. look at charts.  If you are debugging for final print, note that the
  114. binary file still exists so all you have to do is issue a PLOTEPS
  115. to get the printed version once you like what you see on the screen.
  116. We recommend PLOTEGA even on a VGA monitor as the lettering size is
  117. more pleasing.
  118.  
  119. While PLOX is running it will echo your statements and print any errors
  120. found underneath them.  You can then correct and rerun before you plot.
  121.  
  122.  
  123.                     Data for plotting
  124.  
  125. The data to be plotted must be columns of numbers separated by one or
  126. more blanks.  You may have up to 14 columns in any one file.  Dates may
  127. be given in the form yymmdd and they will be translated to YY.frac for
  128. plotting if the plotting statement (e.g., LINE) specifies it.  Years
  129. less than 50 will have 100 added to allow for dates in the first half
  130. of the 21st century.  Missing numbers may be shown by a single asterisk
  131. (*) and they will be skipped.
  132.  
  133. The columns are referenced by number (1, 2, etc.) from left to right
  134. and are known as items to PLOX.  If not specified, PLOX assumes that
  135. item 1 is the x-value and item 2 the y-value to be plotted.  Plotting
  136. statements may specify which items to plot as:
  137.  
  138.        items ix iy
  139.  
  140. where ix is the x-value column number and iy the y-value column number.
  141. Thus with 3 sets of numbers to plot versus the same set of dates you
  142. could put the dates in column 1 and the numbers in columns 2, 3, and 4
  143. and plot them as follows.
  144.  
  145.    LINE file DATA.DAT items 1 2  item 1 is yymmdd
  146.    LINE file DATA.DAT items 1 3  item 1 is yymmdd
  147.    LINE file DATA.DAT items 1 4  item 1 is yymmdd
  148.  
  149. You may include comment lines in data by starting the line with a slash.
  150. Why not an asterisk for consistency?  Because asterisk is reserved to
  151. show missing values and this in turn is to be consistent with some
  152. other languages (including main frame PLOX) as was the use of
  153. asterisk for comments in statements to begin with.  Sorry about that.
  154.  
  155. You may further elect to have the data for any single plot
  156. immediately follow the plot statement (LINE or BARS) by specifying
  157. file *.  Such data must be ended by a dollar sign ($) in column one.
  158. In this case it would be pointless to have more than 2 columns of
  159. data as that's all you can plot with a single statement.  See the
  160. legend data of BIKE.PIC for an example of this.
  161.  
  162. Another option is to give the data file name as @.  Then you may put
  163. the actual file to use on the PLOX command line, or if you don't put
  164. it there you will be prompted for it.  This may be combined with PLOX
  165. statements allowed in the data file to let you make any number of
  166. similar charts from a single picture description using a different data
  167. file for each chart. See the FUNDINFO.PIC file and associated data files
  168. FUND01.DAT and FUND02.DAT for examples of this.
  169.  
  170.                  Other PLOX feat